#ifndef __LGUIVSLIDER_H__
#define __LGUIVSLIDER_H__

#include "LGUIWindow.h"

class LGUIVSlider : public LGUIWindow  
{
	int value, minValue, maxValue, radius;
	int knobSize;
	short16 knobColor;
	bool dragging;
	int style;
	const TCHAR *text;

	void clamp();
public:
	LGUIVSlider(const TCHAR *text, int id, int _x, int _y, int _w, int _h, int _value, int _min, int _max, int _userdata=-1, short16 knobColor=COLOR(0x407FFF), int _style=0);
	virtual ~LGUIVSlider();

	void draw(int xoff, int yoff);
	void penDown(int px, int py);
	void penMove(int px, int py, bool pressed);
	void penUp(int px, int py);

	void setValue(int v)
	{
		value=v;
		clamp();
	}
	void setLimits(int _minv, int _maxv)
	{
		minValue=_minv;
		maxValue=_maxv;
	}
	void setKnobHeight(float k)
	{
		knobSize=int(k*float(h));
		if (knobSize<6) knobSize=6;
	}

};

#endif //__LGUIVSLIDER_H__